<template>
  <div class="base-tree">
    <el-tree :data="treeData" :props="treeProps" />
  </div>
</template>

<script setup>
import { getProjectTree } from '@/api/projectApi'
// 参数接收
const props = defineProps({})
const treeData = ref([])
const treeProps = ref({})

const getTreeData = async () => {
  const res = await getProjectTree()
  treeData.value = res.data
  console.log('产品树信息->', res);
}
// 在组件挂载之前执行
onBeforeMount(() => {
  getTreeData()
})
// 组件卸载后
onUnmounted(() => { });
// emits回调
const emits = defineEmits(["querySearch"]);
// 通过ref使用
defineExpose({}) 
</script>

<style lang="scss" scoped>
.base-tree {
  width: 15vw;
}
</style>
